package cn.iocoder.yudao.module.biz.dal.mysql.user;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.user.UserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.user.vo.*;

/**
 * 客户 Mapper
 *
 * @author 支付免押
 */
@Mapper
public interface ZmUserMapper extends BaseMapperX<UserDO> {

    default PageResult<UserDO> selectPage(UserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserDO>()
                .eqIfPresent(UserDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(UserDO::getCity, reqVO.getCity())
                .eqIfPresent(UserDO::getAgentCode, reqVO.getAgentCode())
                .eqIfPresent(UserDO::getShopCode, reqVO.getShopCode())
                .eqIfPresent(UserDO::getPhone, reqVO.getPhone())
                .likeIfPresent(UserDO::getRealName, reqVO.getRealName())
                .betweenIfPresent(UserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserDO::getId));
    }

}